package com.slz3.business.module.configManagement.conZoneType.domain;

import com.slz3.business.frame.annotation.ConfigDomain;
import com.slz3.business.module.configManagement.conZoneManage.domain.ConZoneManage;
import com.slz3.business.module.configManagement.conZoneTemplate.domain.ConZoneTemplate;
import com.slz3.business.module.configManagement.conZoneType.repository.ConZoneTypeRepository;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.ColumnDefault;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.List;

@ConfigDomain(repositoryClass = ConZoneTypeRepository.class)
@Entity
@Table(schema = "config_management", name = "con_zone_type")
@Data
@EqualsAndHashCode(callSuper = true)
public class ConZoneType extends ConZoneTypeEntity implements Serializable {

    private static final long serialVersionUID = 3928173855627287110L;

    /**
     * 自增 Long
     */
    @Column(insertable = false)
    @ColumnDefault("nextval('mishang_old_frame_id_seq')")
    private Long incrementId;

    /**
     * 上级专区
     */
    private ConZoneType upperZoneType;

    /**
     * 专区模板
     */
    private ConZoneTemplate zoneTemplate;

    /**
     * 专区行
     */
    @Transient
    private List<ConZoneManage> zoneList;

}
